/*自定义login.js*/
$(function () {
    $(":button").on("click",function () {
        var params = $("#f").serialize();
        $.ajax({
            url:"login",
            type:"POST",
            data:params,
            dataType:"json",
            success:function (data) {
                if(data.code==500){
                    alert(data.message);
                }else {
                    window.location.href="http://localhost:8080/user.jsp";
                }
            },
            error:function(XMLHttpRequest,textStatus){
                if(XMLHttpRequest.status==404){
                    alert("找不到服务器[404]");
                }else if(XMLHttpRequest.status==500){
                    alert("服务器繁忙，请稍后再试[500]");
                }else{
                    alert("发生其他错误"+XMLHttpRequest.status);
                }
            },
            timeout:3000
        });
    });
    /*--------------------------------btn--------------------------------*/
    $("#btn").on("mouseover",function () {
        $(this).css("opacity","1");
    })
    $("#btn").on("mouseout",function () {
        $(this).css("opacity","0.7");
    })
})





